//Albala, Adrián, Paula Clerici and Alejandro Olivares (2023) "Determinants of the Cabinet Size in Presidential Systems." Governance.

tsset cod_pais year_nueva, delta(1)
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L1.SoC id_BIS_modification_ministries, family(poisson) link(log) corr(ar1) force robust
eststo model1

xtgee SoC NPC Gp caolpre orientacionIdeol CoS L1.SoC id_BIS_modification_ministries if dummy_majority==1, family(poisson) link(log) corr(ar1) force robust
eststo model2
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L1.SoC id_BIS_modification_ministries if dummy_majority==0, family(poisson) link(log) corr(ar1) force robust 
eststo model3
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L1.SoC id_BIS_modification_ministries i.decree_outcome, family(poisson) link(log) corr(ar1) force robust
eststo model4
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L1.SoC id_BIS_modification_ministries i.decree_outcome if dummy_majority==1, family(poisson) link(log) corr(ar1) force robust
eststo model5
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L1.SoC id_BIS_modification_ministries i.decree_outcome if dummy_majority==0, family(poisson) link(log) corr(ar1) force robust 
eststo model6

esttab, compress se mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6")

drop _est*
eststo clear
 
///////////// Predictions ////////////////

//Model 1
margins, at((p25) share_gov Gp=(0(.25)1)(mean)NPC CoS L.SoC caolpre=0 id_BIS_modification_ministries=0 orientacionIdeol=1) vsquish expression(predict(mu)) force
margins, at((p50) share_gov Gp=(0(.25)1)(mean)NPC CoS L.SoC caolpre=0 id_BIS_modification_ministries=0 orientacionIdeol=1) vsquish expression(predict(mu)) force
margins, at((p75) share_gov Gp=(0(.25)1)(mean)NPC CoS L.SoC caolpre=0 id_BIS_modification_ministries=0 orientacionIdeol=1) vsquish expression(predict(mu)) force

margins, at((p25) share_gov Gp=(0(.25)1)(mean)NPC CoS L.SoC caolpre=0 id_BIS_modification_ministries=0 orientacionIdeol=0) vsquish expression(predict(mu)) force
margins, at((p50) share_gov Gp=(0(.25)1)(mean)NPC CoS L.SoC caolpre=0 id_BIS_modification_ministries=0 orientacionIdeol=0) vsquish expression(predict(mu)) force
margins, at((p75) share_gov Gp=(0(.25)1)(mean)NPC CoS L.SoC caolpre=0 id_BIS_modification_ministries=0 orientacionIdeol=0) vsquish expression(predict(mu)) force

//Model 2
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L1.SoC id_BIS_modification_ministries if dummy_majority==1, family(poisson) link(log) corr(ar1) force robust
margins, at(Gp=(0(.25)1) (mean)NPC CoS L.SoC caolpre=0 orientacionIdeol=0 id_BIS_modification_ministries=0) expression(predict(mu)) force
 
  
//Model 3 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L1.SoC id_BIS_modification_ministries if dummy_majority==0, family(poisson) link(log) corr(ar1) force robust 
margins, at(Gp=(0(.25)1) (mean)NPC CoS L.SoC caolpre=0 orientacionIdeol=0 id_BIS_modification_ministries=0) expression(predict(mu)) force

 
//SIF - Models excluding observations with fixed portfolios (Table D).

tsset cod_pais year_nueva, delta(1)
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L.SoC if id_BIS_modification_ministries==0, family(poisson) link(log) corr(ar1) force robust
eststo model7

xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC if dummy_majority==1 & id_BIS_modification_ministries==0, family(poisson) link(log) corr(ar1) force robust
eststo model8
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC if dummy_majority==0 & id_BIS_modification_ministries==0, family(poisson) link(log) corr(ar1) force robust 
eststo model9
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L.SoC i.decree_outcome if id_BIS_modification_ministries==0, family(poisson) link(log) corr(ar1) force robust
eststo model10
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC i.decree_outcome if dummy_majority==1 & id_BIS_modification_ministries==0, family(poisson) link(log) corr(ar1) force robust
eststo model1
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC i.decree_outcome if dummy_majority==0 & id_BIS_modification_ministries==0, family(poisson) link(log) corr(ar1) force robust 
eststo model2

esttab, compress se mtitles("Model 7" "Model 8" "Model 9" "Model 10" "Model 11" "Model 12")

drop _est*
eststo clear

//SIF - Models without the Uruguayan case (Table E)

tsset cod_pais year_nueva, delta(1)
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L.SoC id_BIS_modification_ministries if cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model13

xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC id_BIS_modification_ministries if dummy_majority==1 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model14
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC id_BIS_modification_ministries if dummy_majority==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust 
eststo model15
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L.SoC id_BIS_modification_ministries i.decree_outcome if cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model16
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC id_BIS_modification_ministries i.decree_outcome if dummy_majority==1 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model17
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC id_BIS_modification_ministries i.decree_outcome if dummy_majority==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust 
eststo model18

esttab, compress se mtitles("Model 13" "Model 14" "Model 15" "Model 16" "Model 17" "Model 18")

drop _est*
eststo clear

//SIF - Models without the Uruguayan case, and observations with fixed portfolios (Table F). 

tsset cod_pais year_nueva, delta(1)
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L.SoC if id_BIS_modification_ministries==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model9

xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC if dummy_majority==1 & id_BIS_modification_ministries==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model20
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC if dummy_majority==0 & id_BIS_modification_ministries==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust 
eststo model21
 
xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L.SoC i.decree_outcome if id_BIS_modification_ministries==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model122
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC i.decree_outcome if dummy_majority==1 & id_BIS_modification_ministries==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust
eststo model23
 
xtgee SoC NPC Gp caolpre orientacionIdeol CoS L.SoC i.decree_outcome if dummy_majority==0 & id_BIS_modification_ministries==0 & cod_pais!=18, family(poisson) link(log) corr(ar1) force robust 
eststo model24

esttab, compress se mtitles("Model 19" "Model 20" "Model 21" "Model 22" "Model 23" "Model 24")

drop _est*
eststo clear
 
 
//SIF - Correlation matrix (Table G)

xtgee SoC NPC Gp caolpre share_gov orientacionIdeol CoS L1.SoC id_BIS_modification_ministries, family(poisson) link(log) corr(ar1) force robust

estpost correlate NPC Gp caolpre share_gov orientacionIdeol CoS id_BIS_modification_ministries, matrix q list
esttab ., not unstack compress star (+ 0.1 * 0.05 ** 0.01 *** 0.001)
esttab using correlations4.tex, not unstack compress noobs varwidth(33) label
 